<?php
 
class Inbox extends MY_Controller 
{
	var $curl = 'inbox';


	function __construct()
	{
		parent::__construct();
        
        $this->load->model('/public/inbox_model');
        
		$this->validation->set_fields($this->inbox_model->fields);

		$this->data['Title'] = T_('Message Inbox');
				
    }
	
	function index($id = null)
	{

		$this->inbox_model->userID = $this->auth->getID();
    	$this->inbox_model->getMessageInbox();
    	$this->data['Title'] = T_('Message Inbox');
    	
		$this->renderLayout();
    }
    function view($id = null) {
    	
    	if($id != null) {
    		$this->inbox_model->search($id);
    		$this->inbox_model->setReadStatus($id, '1');
    	}
    	$this->view ='/inbox/view';
    	$this->data['Title'] = T_('Message');
  
    	$this->renderLayout();
    }
    function deleteItems() {
 
    	$data = $this->inbox_model->delete($_REQUEST['items']);
    	
    	redirect('/');
    }
}

?>